package com.bym.mall.controller;

import com.bym.mall.service.ICategoryService;
import com.bym.mall.vo.CategoryVo;
import com.bym.mall.vo.ResponseVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 分类模块
 * </p>
 *
 * @author bym
 * @date 2022/06/24
 * @since 2022-03-14
 */
@Slf4j
@Api("分类模块")
@RequestMapping("/mall/category")
@RestController
public class CategoryController {

    @Autowired
    private ICategoryService categoryService;

    @ApiOperation(value = "获取所有目录", notes = "获取所有目录")
    @GetMapping("/categories")
    public ResponseVo<List<CategoryVo>> categories() {
        return categoryService.categories();
    }

}
